<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
	<title>购买会员</title>
	<link rel="stylesheet" type="text/css" href="/static/pay/static/reset_mobile.css">
	<link rel="stylesheet" type="text/css" href="/static/pay/static/iconfont.css">
	<link rel="stylesheet" type="text/css" href="/static/pay/css/index.css">
	<script type="text/javascript" src="/static/pay/static/jquery-2.1.4.min.js"></script>
	<script type="text/javascript" src="/static/pay/static/fontsize.js"></script>
</head>
<body>
	<nav>
		<div class="item active">产品介绍</div>
		<div class="item">购买须知</div>
	</nav>
	<article class="content">
		<img src="/static/pay/WX20181229-134948@2x.png" alt="" class="pic">
		<div class="cho">
			<ul>
			{foreach $level as $v}
				<li class="active" price="￥{$v.price}" value="{$v.id}">
					<i class="iconfont icon-danxuankuang"></i>{$v.title}
					<input type="hidden" name="group_id" value="{$v.id}">
				</li>
			{/foreach}
			</ul>
		
			<!-- <form class="layui-form" style="width:100%;margin:10px 30px" action="">
			{foreach $level as $v}
			<input type="radio" name="group" value="{$v.id}" title="{$v.title}">
			{/foreach}
			</form> -->
		</div>
		<footer>
			<i class="iconfont icon-gou fl"></i>
			<a href="/sys/gou"><span class="fl text">《购买协议》</span></a>		
			<a href="javascript:;" class="fr btn">加入代理</a>
			<span class="fr price">￥100</span>
		</footer>
	</article>
	<article class="tip"><?php echo htmlspecialchars_decode($gou['content']);?>
	</article>	

	<script type="text/javascript">
	layui.use(['form'], function(){
		$(".cho li").click(function(){
			$(this).addClass("active hhh").siblings().removeClass("active hhh");
			$(".icon-danxuan").removeClass("icon-danxuan").addClass("icon-danxuankuang")
			$(this).find("i").removeClass("icon-danxuankuang").addClass("icon-danxuan");
			$(".price").text($(this).attr("price"))
			
		})
		$("nav .item").click(function(){
			$(this).addClass("active").siblings().removeClass("active");
			var index=$(this).index();
			$("article").hide();
			$("article").eq(index).show();
		})

		$('.btn').click(function(){
			var id = $(".hhh").val();
			$.post("{:url('pay/order')}",{id:id},function(res){
					if (res.code ==0) {
						layer.msg(res.msg,{icon: 1, time: 1000},function(){
                            location="{:url('pay/payorder')}";
                        });
					}else{
						layer.msg(res.msg,{icon: 2, time: 1000})
					}
			})
			})
		});
	</script>
</body>
</html>